import http from '@/utils/http'

const BASE_URL = '/cakerun/store-cake-verification'
export interface StoreCakeVerificationStatisticssQuery {
  accountIds?: number[]
  shopIds?: number[]
  city?: string
  lastWeekStartDate: string
  lastWeekEndDate: string
  thisWeekStartDate: string
  thisWeekEndDate: string
  scoreDate1?: string
  scoreDate2?: string
}
export interface StoreCakeVerificationStatisticsResp {
  storeName: number
  itemName: string
  price: string
  verifiedAmount: string
  verifiedQuantity: string
  salesQuantity: number
  totalVerifiedAmount: number
}

export interface StoreCakeVerificationStatisticsReq {
  statisticsDate: string
  accountIds?: string[]
}

export function fetchStoreCakeVerificationStatistics(query: StoreCakeVerificationStatisticssQuery) {
  return http.get<StoreCakeVerificationStatisticsResp[]>(`${BASE_URL}`, query)
}

export function exportStoreCakeVerificationStatistics(query: StoreCakeVerificationStatisticssQuery) {
  return http.download(`${BASE_URL}/export`, query)
}
